Function: fig2base64

CALL:

base64 = fig2base64(HWIN, format)

DESCRIPTION:

Convert figure to base64, to be used in HTML <img> element.

INPUT:

HWIN handle
handle of figure to convert to a base64 array
format string
(optional) with image format, default value: png

OUTPUT:

base64 string
Base64 coded image (for HTML)
data int8[]
bytearray, use this with the correct mime-type (e.g. image/png) to directly display an
image in the browser